//
//  ParleysObject.h
//  ipadclient
//
//  Created by Stéphane Prohaszka on 26/05/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@class Space;
@class Channel;

@interface ParleysService : NSObject {
    @private
    NSMutableData* jsonData;
    
    NSMutableArray* spaces;
    NSMutableArray* channels;
    NSMutableArray* presentations;
    
    NSURLConnection* spacesConnection;
    NSURLConnection* channelsConnection;
    NSURLConnection* presentationsConnection;
    
    int activeSpaceId;
}

@property (nonatomic, retain) NSMutableArray* channels;
@property (nonatomic, retain) NSMutableArray* spaces;
@property (nonatomic, retain) NSMutableArray* presentations;

+ (ParleysService*) sharedService;
- (void) loadSpaces;
- (void) loadChannelsFromSpace:(Space*)space;
- (void) loadChannelsFromSpaceId:(int)spaceId;
- (void) loadPresentationsFromChannel:(Channel*)channel;
- (void) loadPresentationsFromChannel:(int)channelId andSpace:(int)spaceId;
- (void) parseSpacesJSON;
- (void) parseChannelsJSON;
- (void) parsePresentationsJSON;

@end
